package com.cc.service;

import com.cc.po.Blog;
import com.cc.po.User;
import com.cc.vo.BlogQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * 博客管理
 * Created by zcc on 2020/12/17.
 */
public interface BlogService {
    /**
     * 根据id查询博客
     * @param id
     * @return
     */
    Blog getBlog(Long id);


    Blog getAndConvert(Long id);

    /**
     * 条件查询并封装为blog对象
     * @param pageable
     * @param blog
     * @return
     */
    Page<Blog> listBlog(Pageable pageable,BlogQuery blog);
//查询首页显示的所有博客
    Page<Blog> listBlog(Pageable pageable);

    Page<Blog> listBlog(Long tagId,Pageable pageable);

    Page<Blog> listBlog(String query,Pageable pageable);

    List<Blog> listRecommendBlogTop(Integer size);

    Map<String,List<Blog>> archiveBlog();

    Long countBlog();
//新增博客
    Blog saveBlog(Blog blog);
    //更新博客
    Blog updateBlog(Long id,Blog blog);
//删除博客
    void deleteBlog(Long id);

}
